Repository navigation
Report an empty or half-written team file as incomplete - #2720
Merged
Merged
Conversation
A state.json that parses but carries no version ({}, null, [], an empty
string) fell through to the sentence a genuinely newer file gets, telling
the person to update a FlyBot that is already current. Branch on the
missing version before that fall-through and name the real repair: the
file is incomplete, so it has to be moved aside. The newer-version
sentence stays for a version above STATE_VERSION, and the file is still
never changed.
Fixes #2716
Collaborator
Author
|
Verdict: PASS at bfee86c Ran at this tip: Review points, at
Not run: full |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written-by: Dev
Fixes #2716
Owner: Dev
Reviewer: Reviewer
What changed
A
state.jsonthat parses but carries noversion({},null,[], an empty string) was answered withsaved by a newer FlyBot; update FlyBot: the person was told to update a program that is already current, and the repair that works — move the empty or half-written file aside — was never said.readFileState()now branches on the missing version before the fall-through and answersthe team file has no version — it is incomplete (an empty or half-written file). The newer-version sentence stays for aversionaboveSTATE_VERSION({"version":999}still readssaved by a newer FlyBot), and in both cases the file is not changed and no.broken-copy is left.Verification at the tip
Tip SHA: bfee86c
Ran (TZ=UTC;
DSH_HARNESSpoints at an existingcore/dev/harnessinstall because this checkout has nonode_modulesof its own):cd core && node --import ./test/harness-resolve.mjs --test test/store.test.js→ 39 pass, 0 fail. Before the source change the same file was 38 pass, 1 fail (a team file with no version is reported as incomplete, not as a newer FlyBot, actual:(saved by a newer FlyBot; update FlyBot)).cd core && node --import ./test/harness-resolve.mjs --test test/install.test.js→ 4 pass, 0 fail.cd core && node --import ./test/harness-resolve.mjs --test test/diagnostics.test.js→ 65 pass, 0 fail (its twonewer FlyBotrows build a{"version":99}file, untouched by this change).node scripts/ds-bot-patches.mjs check→ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/.node core/scripts/build-client.mjs --check→ exit 0 (npm run buildrewrote no byte; no client source touched).cd core && npm run lint(oxlint half) → 0 errors;node scripts/lint-plugins.mjs→ok.node .github/scripts/changelog.mjs check→7 fragment(s) in changelog.d/ are well formed.Not run (and why): full
npm run verify,node scripts/ds-bot-patches.mjs generateandcanonicalneedgit, andarch-docsneedsgit log origin/main..HEAD— this host has no git (and no~/.dshaccess is used).patches/ds-bot/0002-flybot-api-host.patchandpatches/ds-bot/0014-flybot-branding.patchwere updated by hand to the stored form andcheckreproducescore/byte for byte, socanonicalis the gate left to CI;docs/subsystems/core-host.mdis updated in this diff, so arch-docs is covered. Smoke test not run: nothing undercore/index.jsor host startup changed.Checkpoint
{ "pr": 2720, "claim": "Dev", "issue": 2716, "summary": "A team file that parses but carries no version ({}, null, [], an empty string) now answers that it is incomplete, not that a newer FlyBot wrote it. The person is pointed at the file to move aside instead of at an update that cannot help. A version above STATE_VERSION keeps the newer-version sentence, and neither case changes the file or leaves a .broken- copy. A zero-byte or truncated file still takes its backup-and-load-fresh path, and tests in core/test/store.test.js cover all of it.", "files": [ "core/src/host/store.js", "core/test/store.test.js", "patches/ds-bot/0002-flybot-api-host.patch", "patches/ds-bot/0014-flybot-branding.patch", "docs/subsystems/core-host.md", "changelog.d/2716-team-file-incomplete.fixed.md" ], "checks": { "ran": "store.test.js 39 pass, install.test.js 4 pass, diagnostics.test.js 65 pass, ds-bot-patches check, build-client --check, oxlint, lint-plugins, changelog check", "result": "green", "at": "bfee86c2b7c036d19325ba51177c667941b1e076" }, "next": "none — ready for review" }